
'''
    需求：爬取搜狗首页的页面数据
'''
import requests
if __name__ == '__main__':
    # 1.指定url
    url = 'https://www.sogou.com/'
    # 2.发起请求
    response = requests.get(url=url)
    # 3.获取响应数据
    page_text = response.text
    print(page_text)
    # 4.持久化存储
    f =  open('sougou.html', 'w', encoding='utf-8')
    f.write(page_text)
    f.close()
    print('爬取数据结束！')